import request from '@/utils/request'

function findUsersByPage(start, limit) {
  return request({
    url: `/admin/sysAuth/user/findUsersByPage/${start}/${limit}`,
    method: 'post'
  })
}

function saveUserRoles(data) {
  return request({
    url: `/admin/sysAuth/user/saveUserRoles`,
    method: 'post',
    data
  })
}
function findAllRoles() {
  return request({
    url: '/admin/sysAuth/role/findAllRoles'
  })
}

function user(id) {
  return request({
    url: `/admin/sysAuth/user/${id}`
  })
}

function updateUserRoles(data) {
  return request({
    url: '/admin/sysAuth/user/updateUserRoles',
    method: 'put',
    data
  })
}

function removeUser(id) {
  return request({
    url: `/admin/sysAuth/user/removeUser/${id}`,
    method: 'delete'
  })
}
export {
  findUsersByPage,
  saveUserRoles,
  findAllRoles,
  user,
  updateUserRoles,
  removeUser
}
